<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <title>StudentWorld</title>
    <link href="style.css" rel="stylesheet" type="text/css" media="screen" />
</head>
<body>
<?php

require_once 'projekt_st/spletne/controller/OsebaController.php';

$controller = new OsebaController();





if(isset($_POST['brisi'])){
    $profe = $controller->removePovezaveControll($_POST['idPovezave']);
}

if(isset($_POST['uredi'])){
    //print_r($_POST);
    $data['imePovezave']=$_POST['imePovezave'];
    $data['naslovPovezave']=$_POST['naslovPovezave'];
    //print_r($data);
    $profe = $controller->updatePovezava($_POST['idpovezave'],$data);
}

$povezave = $controller->getAllPovezaveControll();

//naredi include, mora biti {}
include_once("seja.php"); 
{
    
?>

    <div id="wrapper">
    	<div id="header-wrapper">
        
    		<?php include_once("glava.php"); ?>
            
    	</div>
    	<!-- end #header -->
    	<div id="page">
    		<div id="page-bgtop">
    			<div id="page-bgbtm">
    				<div id="content">
    					<div class="post">    						
    						<div style="clear: both;">&nbsp;</div>
    						<div class="entry">
                            <?php

foreach($povezave as $pove){

?>
                                    <form method="post" action="<?php $_SERVER['PHP_SELF'] ?>">
                                    
                                        <ul>
                                            <li><input type="text" name="imePovezave" id="imePovezave" value="<?php echo $pove->getImePovezave(); ?>"/></li>
                                            <li><input type="text" name="naslovPovezave" id="naslovPovezave" value="<?php echo $pove->getNaslovPovezave(); ?>"/></li>
                                            <input type="hidden" name="idpovezave" value="<?php echo $pove->getIdpovezave(); ?>" />
                                            <input type="submit" id="brisi" name="brisi" value="Brisi"/>
                                            <input type="submit" id="uredi" name="uredi" value="Uredi"/>
                                        </ul>
                                        
                                    </form>
                                    <?php

}

?>
                                    
    						</div>
    					</div>
    					
    					<div style="clear: both;">&nbsp;</div>
    				</div>
    				<!-- end #content -->
    				<div id="sidebar">
    					<ul>
    						
                            <?php

                                include_once('sidebar.php');

?>
    					</ul>
    				</div>
    				<!-- end #sidebar -->
    				<div style="clear: both;">&nbsp;</div>
    			</div>
    		</div>
    	</div>
    	<!-- end #page -->
    </div>
    <?php  include_once("noga.php"); } ?>
    <!-- end #footer -->
</body>
</html>
